import React, { useEffect, useState } from 'react';
import './selectSearch.less';

export default function (props) {
  const [options, setOptions] = useState([]);
  useEffect(() => {
    setOptions(props.one);
  }, [JSON.stringify(props.one)]);
  return (
    <div>
      <input list="DATALIST" className="selece-item" />
      <datalist id="DATALIST">
        {options?.map((item) => {
          return <option key={item.key}>{item.value}</option>;
        })}
      </datalist>
    </div>
  );
}
